QARenderStart
You can use theQARenderStart
function to initialize a draw context before an engine performs any rendering into that context.
#define QARenderStart(drawContext,dirtyRect,initialContext) \ (drawContext)->renderStart (drawContext,dirtyRect,initialContext)
drawContext
- A draw context.
dirtyRect
- The minimum area of the specified draw context to clear, or the value
NULL
.initialContext
- A previously cached draw context, or the value
NULL
.DESCRIPTION
TheQARenderStart
function performs any operations necessary to initialize the draw context specified by thedrawContext
parameter. This includes clearing the z buffer and the color buffers of the draw context. If the value of theinitialContext
parameter isNULL
, thenQARenderStart
clears the z buffer to 1.0 and sets the color buffers to the values of thekQATag_ColorBG_a
,kQATag_ColorBG_r
,kQATag_ColorBG_g
, andkQATag_ColorBG_b
draw context state variables. If, however, the value of theinitialContext
parameter is notNULL
, thenQARenderStart
uses the previously cached draw context specified by that parameter to initialize the draw context specified by thedrawContext
parameter.The
dirtyRect
parameter indicates the minimum area of the specified draw context to clear on initialization. If the value of thedirtyRect
parameter isNULL
, the entire draw context is cleared. If the value of thedirtyRect
parameter is notNULL
, it indicates the rectangle in the draw context to clear. Some drawing engines may exhibit improved performance when an area that is smaller than the entire draw context rectangle is passed. However, the interpretation of thedirtyRect
parameter is dependent on the drawing engine, which may choose to initialize the entire draw context. As a result, you should not use this parameter as a means to avoid clearing all of a draw context or to perform incremental rendering. Instead, you should use theinitialContext
parameter to achieve such effects.SPECIAL CONSIDERATIONS
You should callQARenderStart
before performing any rendering operations in the specified draw context, and you should call eitherQARenderEnd
to signal the end of rendering operations orQARenderAbort
to cancel rendering operations. However, when a drawing engine is performing OpenGL rendering, theQARenderStart
function operates just like the OpenGL functionglClear
. In OpenGL mode, it is not necessary that a call toQARenderStart
always be balanced by a matching call toQARenderEnd
, and drawing commands may occur at any time.SEE ALSO
See "Using a Draw Context as a Cache" (page 1-20) for information on creating a draw context cache (that is, a draw context you can use as the initial context specified in theinitialContext
parameter).